# 1.导包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
# 2.获取浏览器驱动
driver = webdriver.Firefox()
# 3.打开要测试注册页面
url = 'file:///C:/Users/tedu/Desktop/NSD2406/html/registerA.html'
driver.get(url)
# 4.通过NAME定位账号文本框并输入值
username = driver.find_element(By.NAME, 'userA')
username.send_keys('admin')
# 5.通过NAME定位密码框并输入值
driver.find_element(By.NAME, 'passwordA').send_keys('123456')
# 7.停顿3秒，点击按钮
# 通过TAG_NAME定位按钮并点击
sleep(3)
driver.find_element(By.TAG_NAME, 'button').click()
# 6.停顿3秒，关闭浏览器驱动
sleep(3)
driver.quit()